package com.android.execucaocampo;

import java.text.SimpleDateFormat;

import com.android.beans.OrdemServico;
import com.android.data.RepositorioOrdemServico;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;

public class VoltarAbaActivity extends Activity {

	SimpleDateFormat out = new SimpleDateFormat("dd/MM/yyyy");
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        RepositorioOrdemServico repOs = new RepositorioOrdemServico(getApplicationContext());
        OrdemServico os = repOs.procurar(Integer.parseInt(AbaOrdemServicoActivity.numOS));
        
        Bundle b = new Bundle();		
		b.putString("data", out.format(os.getDataProgramacao()));		
		abrirEditar(b);
	}
	
	public void abrirEditar(Bundle extras){
    	Intent i = new Intent(this,ListaAtividadesActivity.class);
    	finish();
    	i.putExtras(extras);
    	startActivity(i);
    }
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		return false;
	}
}
